import request from '../http.js'

const api = {
   'list' :	'/app/crm/defineField/list',   // 获取当前租户字段列表
   'page' :	'/crm/customer/page',		   // 动态分页查询接口
   'detail' : '/crm/customer/detail',	   // 客户详情
   'city' : '/system/area/treeList',		   // 获取城市
   'save' : '/crm/customer/save',			// 保存客户基本信息
   'delect' : '/crm/customer/disable' ,      // 用户删除
   'namelist' : '/crm/defineField/list'	,  // 获取列表
   'collect': '/crm/customer/collectAdd',	//关注
   'collectOut' : '/crm/customer/collectOut',  // 取消关注
   'release': '/crm/customer/release',		// 释放
   'receive': '/crm/customer/receive',		// 领用
   'dataList': '/system/office/getOfficeTreeDataList', // 获取员工
   'butionSave': '/crm/customer/distributionSave',   //分配
   'userdetail': '/crm/linkman/detail',		//联系人详情
   'distuser':  '/crm/linkman/save',		// 保存联系人
   'stpdel' :  '/crm/linkman/disable', 		// 停用联系人
   'detaildls':  '/crm/touch/detail',		// 联系记录详情
   'touchsave': '/crm/touch/save'		,	// 联系保存
   'toudelet' : '/crm/touch/disable',		// 停用联系记录
   'dealSave': '/crm/customer/dealSave',		// 成交客户
   'saveShare': '/crm/customer/saveShare',		//共享
   'potentialSave': '/crm/customer/potentialSave' ,//退回
	'ForSelect':	'/crm/customer/pageForSelect',	 // 下拉搜索客户
	'activity':	'/crm/activity/page'	,		// 市场活动
	'acdetail': '/crm/activity/detail',			//  市场活动详情		
	'activitysave': '/crm/activity/save',		// 活动保存
   'batchDelete': '/crm/activity/batchDelete',	// 活动删除
   'business': '/crm/business/detail',			// 获取商机详情
   'listCompanyActivities': '/crm/activity/listCompanyActivities'	,// 获取任务列表
   'businesssave': '/crm/business/save',		// 保存商机
   'disable': '/crm/business/disable',			// 商机删除
   'pageList':'/crm/touch/pageList',			// 获取跟进列表
   'Searchsave': '/crm/userSearch/save',		// 保存搜索方案
   'Searchdetail': '/crm/userSearch/detail',	// 获取搜索方案列表	
   'Searchdelete': '/crm/userSearch/delete',	// 搜索删除
   'getUserInfo': '/sysUser/getUserInfo',	// 采单权限
   'actvipageList': '/crm/invitationForm/pageList',	// 活动报名列表
   'getFromList': '/crm/invitationForm/getFromList',	// 获取表单列表
   'linkman': '/crm/linkman/list',	// 获取联系人列表
}

//取消关注
export function collectOut(data){ 
	return request({
		url: api.collectOut,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}

//获取表单列表
export function linkman(data){ 
	return request({
		url: api.linkman,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}


//获取表单列表
export function getFromList(data){ 
	return request({
		url: api.getFromList,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}


//活动报名列表
export function actvipageList(data){ 
	return request({
		url: api.actvipageList,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}


//获取搜索方案列表
export function getUserInfo(data){ 
	return request({
		url: api.getUserInfo,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}
 

//获取搜索方案列表
export function Searchdelete(data){ 
	return request({
		url: api.Searchdelete + "?id=" + data.id,
		method: "delete",
	})
}

//获取搜索方案列表
export function Searchdetail(data){ 
	return request({
		url: api.Searchdetail,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}

//保存搜索方案
export function Searchsave(data){ 
	return request({
		url: api.Searchsave,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}

//获取跟进列表
export function pageList(data){ 
	return request({
		url: api.pageList,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}

//商机删除
export function disable(data){ 
	return request({
		url: api.disable,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}


//保存商机
export function businesssave(data){ 
	return request({
		url: api.businesssave,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}

//获取任务列表
export function listCompanyActivities(data){ 
	return request({
		url: api.listCompanyActivities,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}

//活动删除
export function business(data){ 
	return request({
		url: api.business,
		method: 'GET',
		// contentType:'application/json',
		data:data
	})
}

//活动删除
export function batchDelete(data){ 
	return request({
		url: api.batchDelete,
		method: 'POST',
		// contentType:'application/json',
		data:data
	})
}

//活动保存
export function activitysave(data){ 
	return request({
		url: api.activitysave,
		method: 'POST',
		// contentType:'application/json',
		data:data
	})
}

//市场活动详情
export function acdetail(data){ 
	return request({
		url: api.acdetail,
		method: 'GET',
		// contentType:'application/json',
		data:data
	})
}


//市场活动
export function activ(data){ 
	return request({
		url: api.activity,
		method: 'GET',
		// contentType:'application/json',
		data:data
	})
}



//下拉搜索客户(没有公海数据)
export function ForSelect(data){ 
	return request({
		url: api.ForSelect,
		method: 'POST',
		// contentType:'application/json',
		data:data
	})
}



//共享
export function potentialSave(data){ 
	return request({
		url: api.potentialSave,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}


//共享
export function saveShare(data){ 
	return request({
		url: api.saveShare,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}



//成交客户
export function dealSave(data){ 
	return request({
		url: api.dealSave,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}



//联系保存
export function toudelet(data){ 
	return request({
		url: api.toudelet,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}



//联系保存
export function touchsave(data){ 
	return request({
		url: api.touchsave,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}


//联系记录详情
export function detaildls(data){ 
	return request({
		url: api.detaildls,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}



//停用联系人
export function stpdel(data){ 
	return request({
		url: api.stpdel,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}


//保存联系人
export function distuser(data){ 
	return request({
		url: api.distuser,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}


//联系人详情
export function userdetail(data){ 
	return request({
		url: api.userdetail,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}



//分配
export function butionSave(data){ 
	return request({
		url: api.butionSave,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}


//获取员工
export function dataList(data){ 
	return request({
		url: api.dataList,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}



//获取当前租户字段列表
export function list(data){ 
	return request({
		url: api.list,
		method: 'GET',
		contentType:'application/json',
		// params:data
		data:data
	})
}

//获取客户动态分页列表查询接口
export function pages(data){
	return request({
		url: api.page,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}  


//获取用户详情  ?current=1&size=-1
export function detail(data){
	return request({
		url: api.detail,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
}  


// 获取城市 
export function city(data){
	return request({
		url: api.city,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
} 


// 保存
export function save(data){
	return request({
		url: api.save,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
} 


// 删除
export function delect(data){
	return request({
		url: api.delect,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
} 


// 获取列表
export function namelist(data){
	return request({
		url: api.namelist,
		method: 'GET',
		contentType:'application/json',
		data:data
	})
} 



// 关注
export function collect(data){
	return request({
		url: api.collect,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
} 


// 释放
export function release(data){
	return request({
		url: api.release,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}


// 领用
export function receive(data){
	return request({
		url: api.receive,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}



// 获取员工列表
export function UserList(data){
	return request({
		url: api.UserList,
		method: 'POST',
		contentType:'application/json',
		data:data
	})
}










